<template>
	<Tabs>
		<TabPane label="积分管理">
			<Form ref="form" :model="formData" label-position="top" :rules="rules">
				<FormDescItem label="积分获取比例" desc="设置购物积分获得比例，每消费一元(实付金额)可获得多少积分">
					<InputNumber />
				</FormDescItem>
				<FormDescItem label="消费是否允许积分抵用" desc="设置是否允许下单购物时使用积分抵扣现金">
					<RadioGroup>
				        <Radio label="不可抵扣"></Radio>
				        <Radio label="可抵扣"></Radio>
				    </RadioGroup>
				</FormDescItem>
				<FormDescItem desc="设置购物积分抵扣比例，每消费多少积分可抵扣一元"></FormDescItem>
				<ui-box style="margin-top: -54px; width: 300px;">
					<FormItem label="积分抵扣比例">
						<InputNumber style="width: 100%;" />
					</FormItem>
					<FormItem label="结算时是否默认抵扣积分">
						<RadioGroup>
					        <Radio label="默认抵扣"></Radio>
					        <Radio label="默认不抵扣"></Radio>
					    </RadioGroup>
					</FormItem>
					<FormItem label="结算时是否默认抵扣积分" style="margin-bottom: 0;">
						<CheckboxGroup>
					        <Checkbox label="商品金额"></Checkbox>
					        <Checkbox label="运费"></Checkbox>
					    </CheckboxGroup>
					</FormItem>
				</ui-box>
				<FormDescItem label="积分清零设置" desc="设置所获得积分是否允许清零及清零规则">
					<RadioGroup>
				        <div><Radio label="不清零"></Radio></div>
				        <div><Radio label="自然年清零上一年所获积分"></Radio></div>
				        <div><Radio label="自然年清零所有积分"></Radio></div>
				    </RadioGroup>
				</FormDescItem>
				<FormItem>
					<Button type="primary" :loading="committing" @click="handleSubmit">保存设置</Button>
				</FormItem>
			</Form>
		</TabPane>
	</Tabs>
</template>

<script>
import Util from '@/libs/util.js';
import FormDescItem from '@/components/form/FormDescItem.vue';
export default {
	components: {
		FormDescItem
	},
	data() {
		return {
			committing: false,
			formData: {
				name: ''
			},
			rules: {
				
			}
		}
	},
	mounted() {
		this.init();
	},
	methods: {
		init() {
			
		},
		handleSubmit() {
			if(this.committing) return false;
			this.$refs.form.validate(valid => {
                if(valid) {
                	
                }
            });
		}
	}
}
</script>